/*
 * @Author: boyyang
 * @Date: 2022-01-04 11:36:59
 * @LastEditTime: 2022-02-25 13:21:06
 * @LastEditors: boyyang
 * @Description: 
 * @FilePath: \boyyang\src\utils\TSTEST.ts
 */

import { env } from "@/utils/env"
import { dataType } from '@/utils/dataType'

class Event {
    private queue: any[] = []

    public listen(key: any, func: (...args: any) => any) {
        if (!this.queue[key]) {
            this.queue[key] = []
        }
        this.queue[key].push(func)
    }

    public trigger(...arg: any) {
        let key = Array.prototype.shift.call(arguments)
        let funcs = this.queue[key]

        if (!funcs || funcs.length === 0) {
            return false
        }
        for (let i = 0, fn; fn = funcs[i++];) {
            fn.apply(this, arguments)
        }
    }
}

let event = new Event()

const obj = {
    name: "boyyang",
    age: 18
}

// const handler: ProxyHandler<T> = {

// }

// const proxy = new Proxy<T>(obj, handler: ProxyHandler<T>)














